#include "Particule.h"

Particule::Particule(
					   double positionX,double positionY,double positionZ,
					   double directionX,double directionY,double directionZ,
						
					   double duree_vie, double vitesse_disparition)
{
	
	this->m_xp= positionX;
	this->m_yp= positionY;
	this->m_zp= positionZ;

	this->m_xd= directionX;
	this->m_yd= directionY;
	this->m_zd= directionZ;

	//this->m_r = rouge;
	//this->m_g = vert;
	//this->m_b = bleu;

	m_vie = duree_vie;
	m_fade = vitesse_disparition;
}

Particule::Particule(void)
{
	this->m_xp= 0;
	this->m_yp= 0;
	this->m_zp= 0;

	this->m_xd= 0;
	this->m_yd= 0;
	this->m_zd= 0;

	this->m_r = 0;
	this->m_g = 0;
	this->m_b = 0;

	m_vie = 1.0 ;
	m_fade = 0.05;
}

Particule::~Particule(void)
{

}

void Particule::setPosition(double positionx,double positiony,double positionz)
{
	this->m_xp =positionx;
	this->m_yp =positiony;
	this->m_zp =positionz;
}

void Particule::setDirection(double directionx,double directiony,double directionz) 
{
	this->m_xd =directionx;
	this->m_yd =directiony;
	this->m_zd =directionz;
}

void Particule::setColor(float rouge,float vert,float bleu)
{
	this->m_r = rouge;
	this->m_g = vert;
	this->m_b = bleu;
}

double* Particule::getPosition()
{
	double * tmp = new double [3];
	tmp [0] = m_xp;
	tmp [1] = m_yp;
	tmp [2] = m_zp;

	return tmp;
}

double * Particule::getColor()
{
	double * tmp = new double[3];
	tmp[0]=m_r;
	tmp[1]=m_g;
	tmp[2]=m_b;

	return tmp;
}

double * Particule::getDirection()
{
	double * tmp = new double[3];
	tmp[0]=m_xd;
	tmp[1]=m_yd;
	tmp[2]=m_zd;

	return tmp;
}

void Particule::setVie(double life)
{
	m_vie=life;
}

double Particule::getVie()
{
	return m_vie;
}

double Particule::getFade()
{
	return m_fade;
}
